// https://pintia.cn/problem-sets/14/problems/3006

#include <cstdio>
#include <iostream>
using namespace std;

int main()
{
    int num, n, temp = 0, flag = 0;
    scanf("%d %d", &num, &n);
    if (num == 0 ||n == 0)
    {
        printf("0");
        return 0;
    }
    int a[n + 1];
    for (int i = 0; i < n; i++)
    {
        //该位数部分
        if (i == 0)
            a[i] = num * (n - i) % 10;
        else
            a[i] = (num * (n - i) % 10 + temp) % 10;
        //a[i] = (int)(num * ((n - i + 1) + temp)) % 10;
        //进位部分
        temp = (num * (n - i) + temp) / 10;
        if (i == n - 1 && temp != 0)
        {
            a[n] = 1;
            flag = 1;
        }
        //temp = (int)(num * ((n - i + 1) + temp)) / 10;
    }
    if (flag == 1)
        for (int i = n; i >= 0; i--)
            printf("%d", a[i]);
    else
        for (int i = n - 1; i >= 0; i--)
            printf("%d", a[i]);
    return 0;
}